import pandas as pd
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import matplotlib as mpl
from sklearn.preprocessing import StandardScaler
from scipy.stats import zscore
mpl.use('TkAgg')

data1 = pd.read_excel("./data/data1.xlsx")
data2 = pd.read_excel("./data/data2.xlsx")

data1.drop(['年','月','日','质量等级'],axis=1,inplace=True)
data2.drop(['V01301','V04001','V04002','V04003'],axis=1,inplace=True)

data = pd.concat([data1, data2], axis=1)
data.rename(columns={"V13305": "precipitation",
                   "V10004_700": "air_pressure",
                   "V11291_700": "wind_speed",
                   "V12001_700": "temperature",
                   "V13003_700": "humidity"},
          inplace=True)
print(data)

sns.set_theme(style="ticks")
sns.boxplot(data=data1)
plt.show()

df = pd.read_csv("data/Q3data.csv",index_col=0)
sns.set_theme(style="ticks")
sns.boxplot(data=df)
plt.show()


# # Initialize the figure with a logarithmic x axis
# f, ax = plt.subplots(figsize=(7, 6))
# ax.set_xscale("log")
#
# # Load the example planets dataset
# diamonds = sns.load_dataset("diamonds")
#
# print(diamonds)
# # Plot the orbital period with horizontal boxes
# sns.boxplot(x="distance", y="method", data=planets,
#             whis=[0, 100], width=.6, palette="vlag")
#
# # Add in points to show each observation
# sns.stripplot(x="distance", y="method", data=planets,
#               size=4, color=".3", linewidth=0)
#
# # Tweak the visual presentation
# ax.xaxis.grid(True)
# ax.set(ylabel="")
# sns.despine(trim=True, left=True)






